perm filename WAM.TEX[CLS,LSP] blob sn#845858 filedate 1987-09-15 generic text, type T, neo UTF8
\input macros
\drafttrue
\def\bookline{\CLOS\  Specification}
\def\chapline{Functions in the Programmer Interface}

\begincom{with-added-methods}\ftype{Special Form}

\label Purpose:

The {\bf with-added-methods} special form is an extension to the \OS\ {\bf
generic-labels}.  It produces new generic functions and establishes new
local function definition bindings.  Each generic function is created by
adding the set of methods specified by its method definitions to the
methods of the lexically visible generic function of the same name.

The special form {\bf with-added-methods} is used to define functions
whose names are meaningful only locally and to execute a series of
forms with these function definition bindings.  Any number of
such local functions may be defined.  

The names of functions defined by {\bf with-added-methods} have lexical
scope; they retain their local definitions only within the body of the
{\bf with-added-methods} construct.  Any references within the body of the
{\bf with-added-methods} construct to functions whose names are the same
as those defined within the {\bf with-added-methods} form are thus
references to the local functions instead of to any global functions
of the same names.  The scope of these function definition bindings
includes the definitions themselves as well as the body of the {\bf
with-added-methods} construct.

The {\it form\/} arguments are executed in  order.

\label Syntax:

\Defspec _{with-added-methods} {
\lparen{\rm$\{$}
\lparen \it name 
\vtop{
\hbox{\star{\curly{method-qualifiers}}}
\hbox{specialized-lambda-list}
\hbox{\star{\curly{declaration $\vert$ documentation}}}
\hbox{\star{\curly{form}} \rparen \star{\rm$\}$}\rparen\enskip\star\form}}}

\label Arguments:

The {\it method-qualifiers\/} and {\it specialized-lambda-list\/} arguments
are the same as for {\bf defmethod}.

\label Values:

The result returned by {\bf with-added-methods} is the value or values
returned by the last form executed.  If no forms are specified, 
{\bf with-added-methods} returns {\bf nil}.

\label Remarks:

A {\bf with-added-methods} local method definition is identical in form to the
method definition part of a {\bf defmethod}.

The fact that a generic function is already bound to a variable of the
same name or to a symbol is irrelevant to the operation of this
form.

\label See Also:

{\bf generic-flet

defmethod

defgeneric-options

generic}

\endcom
\end